home *** CD-ROM | disk | FTP | other *** search
- {$A+,B-,D-,E-,F-,G+,I+,L-,N-,O-,P-,Q-,R-,S-,T-,V+,X+}
- {$M 16384,0,655360}
- uses mouse;
- type nimage = Array[0..65534] of Byte;
- Var
- map : ^nimage;
- c,celine : pointer;
- f : file;
- x,y,coul : integer;
- compt : integer;
- pal : array[0..767] of byte;
- i : integer;
- cx,cy : integer;
-
-
- Procedure Lumiere (PosX,Posy : word); Assembler;
- var
- lx,ly : integer;
- i,j,coul1,coul2 : integer;
- asm
- mov di,321
-
- mov ax,1
- sub ax,posy
- mov ly,ax
-
- mov i,198
- @boucle_Y:
-
- mov ax,1
- sub ax,posx
- mov lx,ax
-
- mov j,318
- @boucle_X:
-
- mov ax, word ptr map[2]
- mov es,ax
-
- xor bx,bx
-
- xor ax,ax
- mov al,es:[di+1]
- mov bl,es:[di-1]
- sub ax,bx
- mov x,ax
-
- xor ax,ax
- mov al,es:[di+320]
- mov bl,es:[di-320]
- sub ax,bx
- mov y,ax
-
- inc lx
-
- mov ax,x {calcul de coul1:x}
- sub ax,lx
- cwd {abs(ax)}
- xor ax,dx
- sub ax,dx
- mov bx,128
- sub bx,ax
- cmp bx,0
- jg @lapin
- mov bx,0
- @lapin:
-
- mov ax,y {coul2}
- sub ax,ly
- cwd
- xor ax,dx
- sub ax,dx
- mov cx,128
- sub cx,ax
- cmp cx,0
- jg @elephant
- mov cx,0
- @elephant:
-
- mov ax,bx {coul1*coul2}
- mul cx
- mov bx,64
- div bx
- cmp ax,255
- jbe @girafe
- mov ax,255
- @girafe:
- mov bx,word ptr celine[2]
- mov es,bx
- mov es:[di],al
- inc di
-
- dec j
- jnz @boucle_X
-
- inc ly
-
- add di,2
- dec i
- jnz @boucle_Y
- end;
-
- Procedure WaitRetrace; assembler;
- asm
- mov dx,3dah
- @wait1:
- in al,dx
- test al,08h
- jnz @wait1
-
- @wait2:
- in al,dx
- test al,08h
- jz @wait2
- end;
-
- procedure CopyScreen ; assembler;
- asm
- push ds
- mov ax,0A000H
- mov es,ax
- xor di,di
- lds si,celine
- mov cx,16000
- db 66H; rep movsw
- pop ds
- end;
-
-
- Begin
- c:=ptr($a000,0);
- New(map);
- getmem(celine,64000);
-
- asm
- mov ax,13h
- int 10h
-
- db 66H; xor ax,ax
- les di,celine
- mov cx,16000
- db 66H; rep stosw
-
- end;
- assign(f,'bump.img');
- reset(f,1);
- blockread(f,map^,64000);
- close(f);
-
- port[$3C8]:=0;
- for i:=0 to 767 do port[$3C9]:=i*(i mod 3) div 24;
-
-
- compt:=0;
-
-
- repeat
- Lumiere(mousegetposx shr 1,mousegetposy);
- WaitRetrace;
- copyscreen;
- inc(compt);
- until (port[$60]<$80) or (mouseleft) ;
-
- asm
- mov ax,3h
- int 10h
- end;
- End.
-